import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { Vip360GiftBagInfo } from "./info/Vip360GiftBagInfo";
//class Vip360GiftBagConfig
    
    export  class Vip360GiftBagConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            this._infoArr = [];
            if (Vip360GiftBagConfig._instance != null) 
            {
                throw new Error("Vip360GiftBagConfig 单例");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_vip_gift_bag_360.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new Vip360GiftBagInfo();
                loc1.giftBagCode = loc2.giftBagCode;
                loc1.id = loc2.id;
                loc1.vipType = loc2.vipType;
                this._map[loc1.id] = loc1;
                this._infoArr.push(loc1);
            }
            return;
        }

        public getGiftInfos(): Array<any>
        {
            return this._infoArr;
        }

        public static get instance(): Vip360GiftBagConfig
        {
            if (Vip360GiftBagConfig._instance == null) 
            {
                Vip360GiftBagConfig._instance = new Vip360GiftBagConfig();
            }
            return Vip360GiftBagConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_infoArr: Array<any>;

        /* internal */ static /* var */_instance: Vip360GiftBagConfig;
    }
